-
Notifications
You must be signed in to change notification settings - Fork 732
Improved mouse support #1481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved mouse support #1481
Conversation
fffbd83
to
5daaafb
Compare
(35, 'M') : (NO_BUTTON, MOUSE_MOVE, NO_MODIFIER), # none_drag 35+ + + =35 | ||
(39, 'M') : (NO_BUTTON, MOUSE_MOVE, SHIFT), # none_drag Shift 35+4+ + =39 | ||
(43, 'M') : (NO_BUTTON, MOUSE_MOVE, ALT), # none_drag Alt 35+ +8+ =43 | ||
(47, 'M') : (NO_BUTTON, MOUSE_MOVE, SHIFT_ALT), # none_drag Shift Alt 35+4+8+ =47 | ||
(51, 'M') : (NO_BUTTON, MOUSE_MOVE, CONTROL), # none_drag Control 35+ + +16=51 | ||
(55, 'M') : (NO_BUTTON, MOUSE_MOVE, SHIFT_CONTROL), # none_drag Shift Control 35+4+ +16=55 | ||
(59, 'M') : (NO_BUTTON, MOUSE_MOVE, ALT_CONTROL), # none_drag Alt Control 35+ +8+16=59 | ||
(63, 'M') : (NO_BUTTON, MOUSE_MOVE, SHIFT_ALT_CONTROL), # none_drag Shift Alt Control 35+4+8+16=63 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No button mouse movement is lowercase m
on WSL. I'm not sure if it's a bug here or with windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, indeed. Possibly it's the Windows terminal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's odd...is there a way to detect that? Or we could just detect both M and m
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just duplicate this block with a lowercase m
for WSL if that's something you want to support.
Added more mouse support functionality, including the ability to discriminate which mouse button was pressed as well as reporting click-drags, and mouse movements when no mouse button is pressed. Also improved mouse support while text editing: when you click and drag, your selection will be shown in realtime (as opposed to having to release the mouse press to see the resulting selection). To see this functionality in action, try running examples/full-screen/text-editor.py, write some text, then click and drag over that text to select it. Commit co-authored by: Jonathan Slenders
bed8b62
to
8137774
Compare
This is great! Is there anything I can help with to get this merged? |
@AnthonyDiGirolamo, I'm probably going to merge this. What needs to be done is the handling of all modifiers on Windows systems, but I don't have time to work on that right now. |
Added more mouse support functionality, including the ability to discriminate
which mouse button was pressed as well as reporting click-drags, and mouse
movements when no mouse button is pressed. Also improved mouse support while
text editing: when you click and drag, your selection will be shown in realtime
(as opposed to having to release the mouse press to see the resulting
selection).
To see this functionality in action, try running
examples/full-screen/text-editor.py, write some text, then click and drag over
that text to select it.
Original pull request: #1387
This PR takes the same changes, rebased on "master" + adds a few fixes related to Windows.
TODO: